layout (location = 0) out vec4 eceGlPosition;
layout (location = 1) out vec4 eceGlNormal;
layout (location = 2) out vec4 eceGlAlbedoSpec;
layout (location = 3) out vec4 eceGlGameData;

uniform ece_Material material;
uniform bool blendEnable;
uniform sampler2D texture;
uniform sampler2D blendAlpha;
uniform sampler2D blendTexture;
varying vec2 vTexCoord;
varying vec2 vBlendTexCoord;
varying vec3 vNormal;
varying vec3 vPosition;
varying float vDistance;
void main() {
	vec4 baseColor = texture2D(texture, vTexCoord);
	vec3 color = baseColor.rgb;
	if(blendEnable) {
		vec4 alpha = texture2D(blendAlpha, vBlendTexCoord);
		vec3 blend = texture2D(blendTexture, vBlendTexCoord).rgb;
		color = mix(color, blend, alpha.r);
	}
    eceGlPosition.rgb = vPosition;
	eceGlPosition.a = vDistance;
	eceGlNormal.rgb = vNormal;
	eceGlNormal.a = material.enable ? material.shininess : 24;
	eceGlAlbedoSpec.rgb = material.enable ? color * material.diffuse : color;
	eceGlAlbedoSpec.a = material.specular.r;
	//可以进行贴花
	eceGlGameData.r = 1.0;
}